{
LANG : PASCAL
PROB : friday
}

program FRIDAY;
const
  fi = 'friday.in';
  fo = 'friday.out';
  m : array[0..1, 0..11] of longint = (
  (31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30),
  (31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30));
var
  date, month, year, leap, n : longint;
  res : array[1..7] of longint;

function isleap(year : longint) : boolean;
begin
  if year mod 100 = 0 then
    isleap := year mod 400 = 0
  else
    isleap := year mod 4 = 0;
end;

procedure init;
begin
  fillchar(res, sizeof(res), 0);
  date := 4;
end;

procedure process;
var
  remain : longint;
begin
  for year := 1900 to 1900+n-1 do
  begin
    if isleap(year) then leap := 1
    else leap := 0;
    for month := 1 to 12 do
    begin
      remain := m[leap, month-1] mod 4;
      date := (date + remain - 1) mod 7 + 1;
      inc(res[date]);
    end;
  end;
end;

procedure out;
var
  i : longint;
begin
  write(res[7], ' ');
  for i := 1 to 5 do write(res[i], ' ');
  write(res[6]);
  writeln;
end;

begin
  assign(input, fi); reset(input);
  assign(output, fo); rewrite(output);
  read(n);
  init;
  process;
  out;
  close(output);
  close(input);
end.